package com.anjubao.parking.municipal.parkinglot.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhuchunfeng
 * @date 2019/4/12 13:56
 */
@Getter
@AllArgsConstructor
public enum DeviceTypeEnum {

    //类型 1:充电桩,2:视频桩,3:地磁,4:pda,5:诱导屏
    CHARGING_PILE(1, "充电桩"),
    VIDEO_PILE(2, "视频桩"),
    GEOMAGNETIC_SENSOR(3, "地磁"),
    PDA(4, "pda"),
    GUIDANCE_SCREEN(5, "诱导屏");


    private int code;

    private String desc;

    public static DeviceTypeEnum getByCode(int code) {
        for (DeviceTypeEnum typeEnum : values()) {
            if (typeEnum.getCode() == code) {
                return typeEnum;
            }
        }
        return null;
    }

}

